home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat1 / thrash.z / thrash
Text File  |  1998-10-30  |  3KB  |  67 lines

  1.  
  2.  
  3.  
  4. TTTTHHHHRRRRAAAASSSSHHHH((((1111))))                                                            TTTTHHHHRRRRAAAASSSSHHHH((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      thrash - thrash memory to explore paging behavior
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      tttthhhhrrrraaaasssshhhh [args]
  13.  
  14. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.      _t_h_r_a_s_h will allocate a region of its virtual memory of a size given by
  16.      its arguments, and either randomly or sequentially access that memory in
  17.      order to explore the system paging behavior.
  18.  
  19.      The amount of memory to thrash over is specified by a size flag followed
  20.      by an integer argument, whose units are determined by the particular size
  21.      flag used.  The flag may be -m, for megabytes, -p, for pages; or -k for
  22.      kilobytes.  An additional argument of -s implies sequential thrashing;
  23.      the default is random.  Another optional argument, -n count, gives the
  24.      number of references to make before exiting; it defaults to 10000.  An
  25.      optional argument -w followed by an integer time tells thrash to sleep
  26.      for ``time'' seconds after thrashing, but before exiting.
  27.  
  28.      Once the memory is allocated, _t_h_r_a_s_h prints a message on stdout saying
  29.      how much it is using, and then proceeds to thrash over it.
  30.  
  31. UUUUSSSSAAAAGGGGEEEE
  32.      _t_h_r_a_s_h can be used, in conjunction with _c_v_u_s_a_g_e and _s_q_u_e_e_z_e to determine
  33.      the approximate available working memory on a system.  To do so, run the
  34.      command:
  35.                     _s_s_u_s_a_g_e _t_h_r_a_s_h -_m _4
  36.      which asks _t_h_r_a_s_h to use about 4 MB of memory.  When the command
  37.      completes, the resource usage of _t_h_r_a_s_h is printed; the value labeled
  38.      majf gives the number of major page faults it took, that is the number of
  39.      faults that required a physical read.  When run on a machine with a large
  40.      amount of physical memory, this value is the number of faults needed to
  41.      start the program, which is the minimum number for any run.
  42.  
  43.      Then, as superuser, and in a separate window, run _s_q_u_e_e_z_e to lock down
  44.      varying amounts of memory, and rerun ``ssusage thrash -m 4".  The major-
  45.      fault number will remain low at first, but as you squeeze out more and
  46.      more memory, it will rise.  The amount of available memory reported by
  47.      _s_q_u_e_e_z_e at point at which _t_h_r_a_s_h begins to page-fault tells you the
  48.      combined working set of _t_h_r_a_s_h (~ 4MB), the kernel, and any other
  49.      applications you have running.
  50.  
  51. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  52.      ssusage(1), squeeze(1)
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.